package com.forezp.configclient.springboot2Rabbit;

import com.netflix.discovery.converters.Auto;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @version V1.0  </br>
 * @ClassName UserSender </br>
 * @Description TODO  </br>
 * @Author tonywang</br>
 * @DATE 11/26/2018 10:57 AM</br>
 */
@Component
public class UserSender {
    @Autowired
    public AmqpTemplate amqpTemplate;

    public void send(){
        User user=new User();
        user.setName("hzb");
        user.setPass("123456789");
        System.out.println("user send : " + user.getName()+"/"+user.getPass());
        amqpTemplate.convertAndSend("user", user);
    }
}
